#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([rastertokpsl-re], [1.0.1422], [manowar@altlinux.org])

AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([subdir-objects])
AM_MAINTAINER_MODE([enable])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.
AC_CHECK_HEADER([cups/cups.h], [], [
	AC_MSG_ERROR([cups/cups.h not found!])
])
AC_CHECK_LIB([cups], [cupsParseOptions], [], [
	AC_MSG_ERROR([cups library not found!])
])

AC_CHECK_HEADER([cups/raster.h], [], [
	AC_MSG_ERROR([cups/raster.h not found!])
])
AC_CHECK_LIB([cupsimage], [cupsRasterOpen], [], [
	AC_MSG_ERROR([cupsimage library not found!])
])

AC_CHECK_HEADER([jbig.h], [], [
	AC_MSG_ERROR([jbig.h not found!])
])
AC_CHECK_LIB([jbig], [jbg_enc_init], [], [
	AC_MSG_ERROR([jbig library not found!])
])

AC_CHECK_HEADER([math.h], [], [
	AC_MSG_ERROR([math.h not found!])
])
AC_CHECK_LIB([m], [floor], [], [
	AC_MSG_ERROR([math library not found!])
])

# Checks for common header files.
AC_CHECK_HEADERS([fcntl.h string.h stdio.h signal.h], [], [
	AC_MSG_ERROR([essential C headers not found!])
])

# Checks for library functions.
AC_CHECK_FUNCS([setbuf open close memset strcmp printf fprintf fflush malloc free exit], [], [
	AC_MSG_ERROR([essential C functions not available!])
])

# Output
AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile ppd/Makefile])
AC_OUTPUT
